<eq name="sysinfo.sysReShow" value="show">
  <style type="text/css">
      #index-system-info-dialog-tabs .bar {
          border: 1px solid #999999;
          background: #FFFFFF;
          height: 5px;
          font-size: 2px;
          width: 89%;
          margin: 2px 0 5px 0;
          padding: 1px;
          overflow: hidden;
      }

      #index-system-info-dialog-tabs .bar_1 {
          border: 1px dotted #999999;
          background: #FFFFFF;
          height: 5px;
          font-size: 2px;
          width: 89%;
          margin: 2px 0 5px 0;
          padding: 1px;
          overflow: hidden;
      }

      #index-system-info-dialog-tabs .barli_red {
          background: #ff6600;
          height: 5px;
          margin: 0px;
          padding: 0;
      }

      #index-system-info-dialog-tabs .barli_blue {
          background: #0099FF;
          height: 5px;
          margin: 0px;
          padding: 0;
      }

      #index-system-info-dialog-tabs .barli_green {
          background: #36b52a;
          height: 5px;
          margin: 0px;
          padding: 0;
      }

      #index-system-info-dialog-tabs .barli_1 {
          background: #999999;
          height: 5px;
          margin: 0px;
          padding: 0;
      }

      #index-system-info-dialog-tabs .barli {
          background: #36b52a;
          height: 5px;
          margin: 0px;
          padding: 0;
      }
  </style>
</eq>

<style type="text/css">

  #user_freezemanage_toolbar div {
      width: auto;
      height: 40px;
      line-height: 40px;
      margin-left: 20px;
  }

  #user_freezemanage_toolbar div span {
      margin-left: 20px;
  }

  #user_lotterymanage_toolbar div {
      width: auto;
      height: 40px;
      line-height: 40px;
      margin-left: 20px;
  }

  #user_lotterymanage_toolbar div span {
      margin-left: 20px;
  }

  #user_recordmanage_toolbar div {
      width: auto;
      height: 40px;
      line-height: 40px;
      margin-left: 20px;
  }

  #user_recordmanage_toolbar div span {
      margin-left: 20px;
  }

</style>

<div class="easyui-tabs" data-options="fit:true,border:false,plain:true">
  <div title="基本信息">
      <table class="easyui-propertygrid" data-options="
  fit:true,border:false,
  scrollbarSize:0,
  columns:[[{field:'name',title:'属性',width:100},{field:'value',title:'参数',width:100}]],
  data: [
    {name:'用户编号', value:'<{$user_info['user_id']}>'},
    {name:'用户名称', value:'<{$user_info['user_name']}>'},
    {name:'真实姓名', value:'<{$user_info['realname']}>'},
    {name:'手机号码', value:'<{$user_info['mobile']}>'},
    {name:'用户状态', value:'<{$user_status_conf[$user_info['status']]}>'},
    {name:'注册时间', value:'<{$user_info['reg_time']}>'},
  ]"></table>
  </div>

  <div title="修改信息">
      <table class="easyui-propertygrid" data-options="
  fit:true,border:false,
  scrollbarSize:0,
  columns:[[{field:'name',title:'属性',width:100},{field:'value',title:'参数',width:100},{field:'opt',title:'操作',width:100}]],
  data: [
    {name:'用户名称', value:'<{$user_info['user_name']}>'},
    {name:'真实姓名', value:'<{$user_info['realname']}>'},
    {name:'手机号码', value:'<{$user_info['mobile']}>',opt:'<a href=\'javascript:;\' onclick=\'editMobile(<{$user_info['user_id']}>)\'>修改用户信息</a>'},
    {name:'登陆密码',opt:'<a href=\'javascript:;\' onclick=\'initLoginPwdByMobile(<{$user_info['user_id']}>)\'>初始化密码</a>'},
  ]"></table>
  </div>
</div>

<script type="text/javascript">


function initLoginPwdByMobile(user_id) {
  var href = "<{:U('admin/user/initLoginPwdByMobile')}>";
  href += href.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
  $("#globel-dialog-div").dialog({
    title: '初始化密码',
    iconCls: 'icons-application-application_edit',
    width: 380,
    height: 260,
    cache: false,
    href: href,
    modal: true,
    collapsible: false,
    minimizable: false,
    resizable: false,
    maximizable: false,
    buttons: [{
      text: '确定',
      iconCls: 'icons-other-tick',
      handler: function () {
        $("#globel-dialog-div").find('form').eq(0).form('submit', {
          onSubmit: function () {
            var isValid = $(this).form('validate');
            if (!isValid) return false;
            $.messager.progress({text: '处理中，请稍候...'});
            var action = "<{:U('admin/user/initLoginPwdByMobile')}>";
            action += action.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
            $.post(action, $(this).serialize(), function (res) {
              $.messager.progress('close');
              if (!res.status) {
                $.app.method.tip('提示信息', res.info, 'error');
              }
              else {
                $.app.method.tip('提示信息', res.info, 'info');
                $("#globel-dialog-div").dialog('close');
                $("#admin_memberlist_datagrid").datagrid('reload');
              }
            }, 'json');
            return false;
          }
        });
      }
    }, {
      text: '取消',
      iconCls: 'icons-arrow-cross',
      handler: function () {
        $("#globel-dialog-div").dialog('close');
      }
    }]
  });
}

function editMobile(user_id) {
  var href = "<{:U('admin/user/editMobile')}>";
  href += href.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
  console.log(href);
  $("#globel-dialog-div").dialog({
    title: '修改联系方式',
    iconCls: 'icons-application-application_edit',
    width: 370,
    height: 230,
    cache: false,
    href: href,
    modal: true,
    collapsible: false,
    minimizable: false,
    resizable: false,
    maximizable: false,
    buttons: [{
      text: '确定',
      iconCls: 'icons-other-tick',
      handler: function () {
        $("#globel-dialog-div").find('form').eq(0).form('submit', {
          onSubmit: function () {
            var isValid = $(this).form('validate');
            if (!isValid) return false;
            $.messager.progress({text: '处理中，请稍候...'});
            var action = "<{:U('admin/user/editMobile')}>";
            action += action.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
            $.post(action, $(this).serialize(), function (res) {
              $.messager.progress('close');
              if (!res.status) {
                $.app.method.tip('提示信息', res.info, 'error');
              }
              else {
                $.app.method.tip('提示信息', res.info, 'info');
                $("#globel-dialog-div").dialog('close');
                $("#admin_memberlist_datagrid").datagrid('reload');
              }
            }, 'json');
            return false;
          }
        });
      }
    }, {
      text: '取消',
      iconCls: 'icons-arrow-cross',
      handler: function () {
        $("#globel-dialog-div").dialog('close');
      }
    }]
  });
}

function editStatus(user_id) {
  var href = "<{:U('admin/user/editStatus')}>";
  href += href.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
  //admin/user/editrealinfo?user_id=54
  $("#globel-dialog-div").dialog({
    title: '修改用户状态',
    iconCls: 'icons-application-application_edit',
    width: 370,
    height: 230,
    cache: false,
    href: href,
    modal: true,
    collapsible: false,
    minimizable: false,
    resizable: false,
    maximizable: false,
    buttons: [{
      text: '确定',
      iconCls: 'icons-other-tick',
      handler: function () {
        $("#globel-dialog-div").find('form').eq(0).form('submit', {
          onSubmit: function () {
            var isValid = $(this).form('validate');
            if (!isValid) return false;
            $.messager.progress({text: '处理中，请稍候...'});
            var action = "<{:U('admin/user/editStatus')}>";
            action += action.indexOf('?') != -1 ? '&user_id=' + user_id : '?user_id=' + user_id;
            $.post(action, $(this).serialize(), function (res) {
              $.messager.progress('close');
              if (!res.status) {
                $.app.method.tip('提示信息', res.info, 'error');
              }
              else {
                $.app.method.tip('提示信息', res.info, 'info');
                $("#globel-dialog-div").dialog('close');
              }
            }, 'json');
            return false;
          }
        });
      }
    }, {
      text: '取消',
      iconCls: 'icons-arrow-cross',
      handler: function () {
        $("#globel-dialog-div").dialog('close');
      }
    }]
  });
}
</script>
